//
// Created by wxd on 2025/7/27.
//

#pragma once

#include "IBaseCamera.h"
#include "glm/glm.hpp"
#include "glm/ext/matrix_transform.hpp"


class BaseCamera : public IBaseCamera {
public:
    BaseCamera() : m_Position(glm::vec3(0.f)),
                   m_Up(glm::vec3(0.f, 1.f, 0.f)),
                   m_Right(glm::vec3(1.f, 0.f, 0.f)),
                   m_ViewMatrix(glm::identity<glm::mat4>()),
                   m_ProjectMatrix(glm::identity<glm::mat4>()) {}

    BaseCamera(const glm::vec3 pos, const glm::vec3 up, const glm::vec3 right) : m_Position(pos), m_Up(up), m_Right(right),
                                                                                 m_ViewMatrix(glm::identity<glm::mat4>()),
                                                                                 m_ProjectMatrix(glm::identity<glm::mat4>()) {}

    glm::vec3 m_Position;
    glm::vec3 m_Up;
    glm::vec3 m_Right;

    glm::mat4 getViewMatrix() override;
    glm::mat4 getProjectMatrix() override;

    void setCameraParams(glm::vec3 pos, glm::vec3 up, glm::vec3 right);

protected:

    glm::mat4 m_ViewMatrix;
    glm::mat4 m_ProjectMatrix;
};
